<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<head>

<base href="../resources/" />
<meta http-equiv="content-type" content="text/html; charset= UTF-8" />
<title>BBS by nado</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" type="text/css" href="style/style.css" />

<style type="text/css">
table {
	width: 500px;
	border-collapse: collapse;
	text-align: center;
	font-family: 'Trebuchet MS';
}

td,th {
	font-size: 10pt;
	border: 1px solid #ffffff;
	height: 30px;
}

th {
	background-color: #aaaaaa;
	color: #ffffff;
	font-family: Georgia;
}

tr.alt td {
	color: #111111;
	background-color: #dcdcdc;
}
</style>

</head>
<body>


	<div id="main">

		<div id="main_inner" class="fixed">

			<div id="primaryContent_2columns">

				<div id="columnA_2columns">

					<h3>BBS</h3>
					<p>
						<table>
							<tr>
								<th>No</th>
								<th>Title</th>
								<th>Writer</th>
								<th>RegDate</th>
								<th>Count</th>
							</tr>
							<c:forEach var="searchVO" items="${searchList}">
								<tr>
<%-- 								<td>${BBSList }</td> --%>
									<td>${searchVO.BBS_NO}</td>
									<td style="text-align: left">
									<a href="/web/bbs/read?bbs_no=${searchVO.BBS_NO}&page_no=${page_no}" style=text-decoration:none>
											<c:if test="${searchVO.BBS_DEPTH != '0'}">
												<c:forEach begin="1" end="${searchVO.BBS_DEPTH}">
<!-- 												Re: -->
													┗
											</c:forEach>
											</c:if> ${searchVO.BBS_TITLE} (${searchVO.BBS_RECNT})
									</a></td>
									<td>${searchVO.BBS_WRITER}</td>
									<td><c:set var="date" value="${searchVO.BBS_REGDATE}" /> <fmt:formatDate
											value="${date}" pattern="yyyy/MM/dd" /></td>
									<td>${searchVO.BBS_READCNT}</td>
								</tr>
							</c:forEach>
							<tr>
								<td style="text-align: left" colspan="3"><br></br>
								<form action="/web/bbs/search/page_no=${page_no}" method="post">
									<select name="type">
										<option value="bbs_title">제목</option>
										<option value="bbs_content">내용</option>
										<option value="bbs_writer">작성자</option>
									</select>
									<input type="text" name="keyword" size="20"></input>
									<input type="submit" value="검색"></input>
								</form>
								</td>
								<td style="text-align: right" colspan="2">
 								<%-- <form action="/web/bbs/write/page_no=${page_no}" method="post">
										<br></br> <%
											int size = (Integer)session.getAttribute("searchListSize");
											int page_no = (Integer)session.getAttribute("page_no");
// 											out.print("+" +page_no);
											
											double page_size = Math.ceil(Math.ceil(size)/10);
											int pNo = (page_no/10)*10;

// 											out.print(size);
// 											out.print(page_size);
// 											out.print(pNo);
											
											for(int i = pNo+1; i<(pNo+10); i++){
												if(i > 10){
													out.write("<a href='/web/bbs/search/page_no=" + (pNo-9) + "'>"
											 				+ "이전" + "</a> ");
												}
												if(i <= page_size){
													out.write("<a href='/web/bbs/search/page_no=" + i + "'>["
												 				+ i + "]</a> ");
													if(i == (pNo+9)){
														out.write("<a href='/web/bbs/search/page_no=" + (pNo+10) + "'>"
												 				+ "다음" + "</a> ");
														break;
													}
												}
											}

										 %> <input type="submit" name="write" value="글쓰기"></input>
									</form> --%>
								</td>
							</tr>
						</table>
					</p>
				</div>
			</div>

		</div>

	</div>
</body>
</html>